<?php

/*
 * author : wiloke
 * author uri: wiloke.com
 * date: 04/26/2014
 * time: 07 aggregate_methods(object, class_name)
 */

$aOurClients = get_post_meta($post->ID, $post->post_type, true);

$aOurClients = isset($aOurClients['ourclient']) ? $aOurClients['ourclient'] : null;

$logo = QVA_ADMIN_IMG_URI . 'no-img_150x150.jpg';
$aOurClients = wp_parse_args( $aOurClients, array( 'weareworkingwith'=>'We Have <span>Work</span> With', 'logo'=>array($logo), 'link' =>array('#'), 'photo'=>array($logo), 'name'=>array(' '), 'position'=>array(' '), 'testimonial'=>array(' ') ));
?>

<div class="bt-reset">
    <div class="container-12-fluid">
        <div class="container-12-row">
            <div class="large-12">
                <div class="form-group">
                    <label class="form-title">
                        Title
                    </label>
                    <div class="controls">
                        <input type="text" class="form-control" name="ourclient[weareworkingwith]" value="<?php echo isset($aOurClients['weareworkingwith']) && !empty($aOurClients['weareworkingwith']) ? stripslashes(htmlspecialchars($aOurClients['weareworkingwith'])) : ''; ?>">
                        <code class="help">Allow use all html tags</code>
                    </div>
                </div>
            </div>
            
            <?php foreach ($aOurClients['logo'] as $k => $v) : ?>
                <div class="clone-me wrap-delete large-4">
                <div class="panel">
                    <div class="panel-heading">
                        <div class="panel-title"> &nbsp; </div>
                        <div class="panel-options">
                            <a href="#" class="delele-this"><i class="fa fa-times"></i></a>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="controls">
                                <input type="hidden" name="ourclient[logo][]" class="reset" value="<?php echo $v; ?>">
                                <a href="#" class="upload-image singular_upload">
                                    <div class="lux-gallery logo">
                                        <img src="<?php echo $v ?>" alt="" class="bo-picture-ourteam logo_placeholder  live_insert_me">
                                    </div>
                                </a>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="form-label">Our client website</label>
                            <div class="controls">
                                <input type="text" class="reset form-control" name="ourclient[link][]" value="<?php echo esc_url($aOurClients['link'][$k]) ?>"/>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <?php endforeach; ?>
            <div class="bo-add-new wo-wrapclone">
                <div class="">
                    <button class="btn btn-blue aboutus wo-addmore" type="button">Add More</button>
                </div>
            </div>
        </div>
    </div>
</div>
